/*************************************************************************
 > File Name: monolith/util/base64.h
 > Author: dzhang
 > Mail: dong.zhang@ingenic.com
 > Created Time : Wed 03 Feb 2021 09:16:59 PM CST
 > Description:
 ************************************************************************/

#ifndef _MONOLITH_UTIL_BASE64_H
#define _MONOLITH_UTIL_BASE64_H
#pragma once
#include "monolith/core/macros.h"
CC_NAME_SPACE_BEGIN
namespace util {

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis base64 encode
 *
 * @Param src data before encode
 * @Param length data length
 *
 * @Returns data after encoded, need free.
 */
/* ----------------------------------------------------------------------------*/
unsigned char *base64_encode(unsigned char *src, long length);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis base64 decode
 *
 * @Param dest data encoded
 *
 * @Returns data decoded
 */
/* ----------------------------------------------------------------------------*/
unsigned char *base64_decode(unsigned char *dest);

} // namespace util
CC_NAME_SPACE_END

#endif //MONOLITH_UTIL_BASE64_H
